package org.lanplay.server.entitymodel;

import java.io.Serializable;

import javax.persistence.EntityManager;

import org.apache.wicket.model.IModel;
import org.lanplay.server.model.Game;

import com.google.inject.Inject;
import com.google.inject.Provider;

public class EntityModelFactory implements Serializable {
	private static final long serialVersionUID = 1L;

	@Inject
	private Provider<EntityManager> emp;

	public <T extends Identifiable<?>> EntityModel<T> create(T object) {
		return new EntityModel<T>(emp, object);
	}

	public IModel<Game> create(Class<Game> _class, Long id) {
		return new EntityModel<Game>(emp, _class, id);
	}
}
